<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>公司历史</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body>
<div class="Wrapper">
        <form id="cust_company_history_form">
            <div class="fieldset1 tabel_col tabel_col_s clearFix noBorder">
                <div class="fieldBox col_50">
                    <div class="label">项目名称</div>
                    <div class="field">
                         <span id="prjNm"></span>
                    </div>
                </div>
               <div class="fieldBox col_50">
			       <div class="label">开始日期</div>
			       <div class="field">
			           <span id="startDt"></span>
			       </div>
			   </div>
               <div class="fieldBox col_50">
			       <div class="label">结束日期</div>
			       <div class="field">
			       	<span id="endDt"></span>
			       </div>
			   </div>
                
                <div class="fieldBox col_100">
                    <div class="label">描述</div>
                    <div class="field" style="width: 100%;">
                    	<span id="prjDesc"></span>
                    </div>
                </div>
                
                <!-- hide data -->
		        <div class="fieldBox col_100" style="display:none;">
		          <div class="field">
		              <input name="chid" id="chid" type="text" class="ui-textbox" value="${id}">
		          </div>
		        </div>
            </div>
        </form>
      </div>
	<script>
	
	$(function() {
		initForm();
	    initData();
	});
		
		//初始化表单
		function initForm(){
			$("#cust_company_history_form").ligerForm({
                validate: true
           });
		}
		
		frameElement.dialog.onCancel = function () {
			frameElement.dialog.close();
		}

		
		//初始化数据
		function initData(){
			var chid = $("#chid").val();
	    	if(!chid)return;
	    	var _url = '<%=path%>/customer/cstcorphis/getById.do';
	    	AjaxUtils.ajaxGet(_url, {id:chid}, initCallback, true);
    	}
		
		//初始化回调
		function initCallback(msg){
			if(msg.success == 1){
				 setData(msg.data);//设置数据
			 }else{
				 UIUtils.alertError(msg.info);
			 }
		}
		
		//设置页面数据
	    function setData(data){
	    	$("#prjNm").html(data.prjNm);
	    	$("#startDt").html(DateUtils.formatDateToString(data.startDt,DateUtils.YYYY_MM_DD));
	    	$("#endDt").html(DateUtils.formatDateToString(data.endDt,DateUtils.YYYY_MM_DD));
	    	$("#prjDesc").html(data.prjDesc);
		};
	</script>
</body>
</html>